package com.atguigu.jvm;

import java.util.List;
import java.util.concurrent.TimeUnit;

public class VisualableToolsTest {

    public static void main(String[] args) throws InterruptedException {
        while (true) {
            TimeUnit.SECONDS.sleep(1);

            new Thread(()->{
                for (int i = 0; i < Math.random() * 100; i++) {
                    try {
                        TimeUnit.SECONDS.sleep(1);
                        System.out.println(Thread.currentThread().getName() + " is working");
                        byte[] bytes = new byte[1 * 1024 * 1024 * (int)(Math.random() * 100)];
                        List s = null;
                        s.parallelStream();
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }).start();
        }
    }

}
